package com.xianggu.designMode.combination.demo03;

/**
 * @author chengjy
 * @date 2025/3/20
 */
public class CityCountDemo {
    public static void main(String[] args) {
        Province province = new Province("广东省");
        City sz = new City("深圳市");
        City gz = new City("广州市");
        City fs = new City("佛山市");
        City xg = new City("香菇市");
        District nsq = new District("南山区", 100);
        District ftq = new District("福田区", 232);
        District lh = new District("龙华区", 565);

        sz.addDistricts(nsq , ftq , lh);

        province.addCitys(sz , gz , fs , xg);

        System.out.println("广东省人口总数：" + province.counPopulation() + "人");
        System.out.println("深圳市人口总数：" + sz.counPopulation() + "人");

        Province province2 = new Province("广西省");
        City gz2 = new City("贵港市");
        City nn = new City("南宁市");
        nn.addDistricts(new District("江南区", 1000) , new District("青秀区", 1000) , new District("兴宁区", 1000));

        City xg2 = new City("象岗市");
        District nsq2 = new District("南宁区", 43);
        District ftq2 = new District("鱼峰区", 2321);
        District lh2 = new District("龙湖区", 1);

        gz2.addDistricts(nsq2 , ftq2 , lh2);

        province2.addCitys(gz2 , nn , xg2);


        System.out.println("广西省人口总数：" + province2.counPopulation() + "人");
        System.out.println("贵港市人口总数：" + gz2.counPopulation() + "人");
    }
}
